import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Layout from "@/views/admin/layout/index.vue";

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        redirect: "/home",
        component: Layout,
        children: [
            {
                path: "/home",
                name: "home",
                component: () => import("@/views/admin/home/index.vue"),
                meta: {
                    title: "首页",
                    id: "home",
                    // requireAuth: true,
                },
            },
            {
                path: "/test",
                name: "test",
                component: () => import("@/components/test.vue"),
                meta: {
                    title: "测试",
                    id: "test",
                    // requireAuth: true,
                },
            },
            {
                path: "/book",
                name: "book",
                component: () => import("@/views/admin/book/index.vue"),
                meta: {
                    title: "图书管理",
                    id: "book",
                    // requireAuth: true,
                },
            },
        ],
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
